<template>
  <el-dialog
    title="请输入脚本"
    :visible.sync="dialogVisible"
    append-to-body
    width="800px">
    <el-form :model="form" ref="form" label-width="100px" size="mini">
          <el-form-item label="Groovy脚本" prop="type">
            <el-input type="textarea" :rows="6" v-model="form.script" placeholder="请输入脚本">
            </el-input>
          </el-form-item>
    </el-form>
    <span slot="footer" class="dialog-footer">
      <el-button @click="dialogVisible = false">取 消</el-button>
      <el-button type="primary" @click="confirm">确 定</el-button>
    </span>
  </el-dialog>
</template>
<script>
    export default {
        props: {
            value: {
                type: [String],
                default() {
                    return []
                }
            },
        },
        components: {},
        data() {
            return {
                form: {
                  script:'',
                },
                dialogVisible: false,
            }
        },
        computed: {},
        watch: {},
        methods: {
            confirm() {
              this.$emit('input',this.form.script)
                this.dialogVisible = false
            },
            show() {
              this.form.script = this.value
                this.dialogVisible = true
            }
        },
        created() {

        },
        mounted() {

        },
    }
</script>
